﻿@{
    ViewBag.Title = "SearchForm";
    Layout = "~/Views/Shared/_LayoutIndex.cshtml";
}
<script>
    var option = {
        Type: request('Type'),
        StartTime: request('StartTime'),
        EndTime: request('EndTime'),
        Code: request('Code'),
        Name: decodeURI(request('Name')),
        IDCard: request('IDCard'),
        PStruct: decodeURI(request('PStruct')),
    };
    $(function () {
        //资格申请单
        if (option.Type == 1) GetGrid1();
        //合同
        if (option.Type == 2) GetGrid2();
        //续租申请
        
        if (option.Type == 3) GetGrid3();
        //退租申请
        if (option.Type == 4) GetGrid4();
        //会员信息
        if (option.Type == 5) GetGrid5();
        //选房记录
        if (option.Type == 6) GetGrid6();
        //看房申请
        if (option.Type == 7) GetGrid7();
    })

    function btn_detail() {
        //资格申请单
        if (option.Type == 1) {
            var keyValue = $("#gridTable").jqGridRowValue("code");
            var State = $("#gridTable").jqGridRowValue("state");
            if (State < 4) {
                top.tablist.newTab({
                    id: "FirstTrialForm" + keyValue,
                    title: '单据详情【初审:' + keyValue + '】',
                    closed: true,
                    icon: "fa fa-eye",
                    url: top.contentPath + '/QualificationManage/FirstTrial/Form?keyValue=' + keyValue
                });
            } else {
                top.tablist.newTab({
                    id: "RetrialForm" + keyValue,
                    title: '单据详情【复审' + keyValue + '】',
                    closed: true,
                    icon: "fa fa-eye",
                    url: top.contentPath + '/QualificationManage/Retrial/Form?keyValue=' + keyValue
                });
            }

        }
        //合同
        if (option.Type == 2) {
            var keyValue = $("#gridTable").jqGridRowValue("id");
            var Code = $("#gridTable").jqGridRowValue("code");
            if (checkedRow(keyValue)) {
                top.tablist.newTab({
                    id: "Form",
                    title: '合同详情【' + Code + '】',
                    closed: true,
                    icon: "fa fa-eye",
                    url: top.contentPath + '/QualificationManage/RentContract/Form?keyValue=' + keyValue
                });
            }
        }
        //续租申请、退租申请
        if (option.Type == 3||option.Type ==4) {
            var keyValue = $("#gridTable").jqGridRowValue("id");
            var ContractId = $("#gridTable").jqGridRowValue("contractid");
            var type = $("#gridTable").jqGridRowValue("type");
            var LiveInUserId = $("#gridTable").jqGridRowValue("liveinuserid");
            if (checkedRow(keyValue)) {
                switch (type) {
                    case "合同变更":
                        type = 1;
                        break;
                    case "合同续租": type = 2; break;
                    case "合同到期退租": type = 3; break;
                    case "合同提前退租": type = 4; break;
                    default:
                        dialogMsg("数据错误，请选择其他数据！", 0);
                        return false;
                        break;
                }
                var url = '/QualificationManage/Contract/Detail?keyValue=' + keyValue + "&ContractId=" + ContractId + "&Type=" + type + "&MemberId=" + LiveInUserId;
                dialogOpen({
                    id: "Detail",
                    title: '查看',
                    url: url,
                    width: "1100px",
                    height: "750px",
                    btn: ["关闭"],
                    callBack: function (iframeId) {
                        top.frames[iframeId].AcceptClick();
                    }
                });
            }
        }
        
        //会员信息
        if (option.Type == 5) {
            var keyValue = $("#gridTable").jqGridRowValue("Id");
            var Name = $("#gridTable").jqGridRowValue("Name");
            if (checkedRow(keyValue)) {
                top.tablist.newTab({
                    id: "MemberDetails",
                    title: '会员详情【' + Name + '】',
                    closed: true,
                    icon: "fa fa-eye",
                    url: top.contentPath + '/QualificationManage/Member/Details?keyValue=' + keyValue
                });
            }
        }
        //选房记录
        if (option.Type == 6) {
            var keyValue = $("#gridTable").jqGridRowValue("id");
            if (checkedRow(keyValue)) {
                dialogOpen({
                    id: "Form",
                    title: '选房记录',
                    url: '/QualificationManage/SelectRoomRecord/Form?keyValue=' + keyValue,
                    width: "1100px",
                    height: "750px",
                    callBack: function (iframeId) {
                        top.frames[iframeId].AcceptClick();
                    }
                });
            }
        }
        //看房申请
        if (option.Type == 7) {
            var keyValue = $("#gridTable").jqGridRowValue("billcode");
            if (checkedRow(keyValue)) {
                dialogOpen({
                    id: "Form",
                    title: '单据详情(看房申请单)',
                    url: '/QualificationManage/SearchRoom/Form?keyValue=' + keyValue,
                    width: "1200px",
                    height: "800px",
                    btn: null,
                    callBack: function (iframeId) {
                    }
                });
            }
        }

        dialogClose();
    }
    //资格申请单
    function GetGrid1() { 
        var selectedRowIndex = 0;
        $gridTable = $("#gridTable"); 
        var queryJson = { 
            StartTime: option.StartTime,
            EndTime: option.EndTime,
            Name: option.Name,
            IDCard: option.IDCard
        };
        $gridTable.jqGrid({
            url: "/QualificationManage/FirstTrial/GetPageList",
            postData: { queryJson: JSON.stringify(queryJson) },
            datatype: "json",
            height: $(window).height() - 60,
            autowidth: true,
            colModel: [
                { label: "主键", name: "id", hidden: true },
                { label: "主键", name: "state", hidden: true },
                { label: "单据编号", name: "code", index: "code", width: 200, align: "center", sortable: false },
                { label: "单据时间", name: "date", index: "date", width: 200, align: "center", sortable: false },
                { label: "姓名", name: "name", index: "name", width: 200, align: "center", sortable: false },
                { label: "身份证号码", name: "idcard", index: "idcard", width: 200, align: "center", sortable: false },
               {
                   label: "状态", name: "state", index: "CheckFlag", width: 100, align: "center", sortable: false,
                   formatter: function (cellvalue, options, rowObject) {
                       var Msg = "";
                       switch (cellvalue) {
                           case 1: Msg = "<span  class='label' style='background-color:#74B981'>初审中（初次)</span>";
                               break;
                           case 2: Msg = "<span  style='background-color:#6ABD78' class='label '>初审中（再次）</span>";
                               break;
                           case 0:
                           case 3: Msg = "<span  style='background-color:#B05B5C' class='label '>初审未通过</span>";
                               break;
                           case 4: Msg = "<span  style='background-color:#CCE099' class='label '>递交资料中</span>";
                               break;
                           case 5: Msg = "<span  style='background-color:#C1D169' class='label '>市局审批中（材料通过）</span>";
                               break;
                           case 6: Msg = "<span  style='background-color:#15AD66' class='label '>复审（市局审批通过）</span>";
                               break;
                           case 7: Msg = "<span  style='background-color:#5CB85C' class='label '>复审通过</span>";
                               break;
                           case 8: Msg = "<span  class='label'  style='background-color:#f00' >复审未通过</span>";
                               break;
                           case 9: Msg = "<span  style='background-color:#ccc' class='label '>客户撤回</span>";
                               break;
                           case 10: Msg = "<span  style='background-color:#B05B5C' class='label '>材料未通过</span>";
                               break;
                           default: Msg = cellvalue;
                               break;
                       }
                       return Msg;
                   }
               },
                {
                    label: "性别", name: "sex", index: "sex", width: 100, align: "center", sortable: false,
                    formatter: function (cellvalue) {
                        switch (cellvalue) {
                            case 1:
                                return "男";
                            case 2:
                                return "女";
                            default: return cellvalue;

                        }
                    }
                },
                { label: "手机号", name: "phone", index: "phone", width: 100, align: "center", sortable: false },
                { label: "提交时间", name: "date", index: "date", width: 100, align: "center", sortable: false },
                { label: "未通过原因", name: "chcekmemo", index: "chcekmemo", width: 100, align: "center", sortable: false }
            ],
            viewrecords: true,
            rowNum: 20,
            rowList: [20, 50, 100],
            pager: "#gridPager",
            sortname: 'date',
            sortorder: 'desc',
            rownumbers: true,
            gridview: true,
            ondblClickRow: function () {
                btn_detail();
            },
            onSelectRow: function (status) {
                selectedRowIndex = $("#" + this.id).getGridParam('selrow');
            },
            gridComplete: function () {
                $("#" + this.id).setSelection(selectedRowIndex, false);
            }
        });
    }
    //合同
    function GetGrid2() {
        var selectedRowIndex = 0;
        $gridTable = $("#gridTable");
        var queryJson = {
            StartTime: option.StartTime,
            EndTime: option.EndTime,
            Name: option.Name,
            IDCard: option.IDCard, 
            Code: option.Code
        };
        $gridTable.jqGrid({
            url: "../../QualificationManage/RentContract/GetPageList",
            postData: { queryJson: JSON.stringify(queryJson) },
            datatype: "json",
            height: $(window).height() - 60,
            autowidth: true,
            colModel: [
                 { label: "主键", name: "id", hidden: true },
                { label: "合同编号", name: "code", index: "code", width: 200, align: "center", sortable: false },
                { label: "状态", name: "state", hidden: true },
                {
                    label: "签约状态", name: "signdatestr", index: "signdate", width: 200, align: "center", sortable: false,
                    formatter: function (cellvalue, options, rowObject) {
                        var msg = cellvalue;
                        if (rowObject.state == 1 || rowObject.state == "1") {
                            msg = "待签约";
                        }
                        if (rowObject.state == 2 || rowObject.state == "2") {
                            msg = "待执行";
                        }
                        if (rowObject.state == 3 || rowObject.state == "3") {
                            msg = "当前";
                        }
                        if (rowObject.state == 4 || rowObject.state == "4") {
                            msg = "历史";
                        }
                        if (rowObject.state == 5 || rowObject.state == "5") {
                            msg = "结束";
                        }
                        return msg;

                    }
                },
                {
                    label: "签约时间", name: "signdate", index: "signdate", width: 200, align: "center", sortable: false,
                    formatter: function (cellvalue, options, rowObject) {
                        var msg = cellvalue;
                        if (rowObject.state == 1 || rowObject.state == "1") {
                            msg = "";
                        }
                        if (cellvalue == null && rowObject.state != 1) {
                            msg = "";
                        }
                        return msg;

                    }
                },
                { label: "租赁房产", name: "allname", index: "allname", width: 200, align: "center", sortable: false },
                {
                    label: "签约主体", name: "signtype", index: "signtype", width: 200, align: "center", sortable: false,
                    formatter: function (cellvalue) {
                        var Msg = "";
                        switch (cellvalue) {
                            case 0:
                            case "0":
                            case "1":
                            case 1: Msg = "单位";
                                break;
                            case "2":
                            case 2: Msg = "个人";
                                break;
                            default: Msg = "---";
                                break;
                        }
                        return Msg;
                    }
                },
                { label: "入住人ID", name: "liveinuserid", hidden: true },
                { label: "入住人姓名", name: "name", index: "name", width: 200, align: "center", sortable: false },
                { label: "所属单位", name: "companyname", index: "companyname", width: 200, align: "center", sortable: false },
                {
                    label: "起始日期", name: "begindate", index: "begindate", width: 200, align: "center", sortable: false,
                    formatter: function (cellvalue) {
                        return formatDate(cellvalue, 'yyyy-MM-dd');
                    }

                },
                {
                    label: "终止日期", name: "enddate", index: "enddate", width: 200, align: "center", sortable: false,
                    formatter: function (cellvalue) {
                        return formatDate(cellvalue, 'yyyy-MM-dd');
                    }
                },
                { label: "月租金", name: "monthlyrent", index: "monthlyrent", width: 200, align: "center", sortable: false },
                { label: "押金", name: "deposit", index: "deposit", width: 200, align: "center", sortable: false },
            ],
            viewrecords: true,
            rowNum: 20,
            rowList: [20, 50, 100],
            pager: "#gridPager",
            sortname: 'Code',
            sortorder: 'desc',
            rownumbers: true,
            gridview: true,
            ondblClickRow: function () {
                btn_detail();
            },
           
        });
    }
    //续租申请
    function GetGrid3() { 
        var $gridTable = $("#gridTable");
        var queryJson = {
            BeginDate: option.StartTime,
            EndDate: option.EndTime,
            Type: 2
        };
        $gridTable.jqGrid({
            url: "../../QualificationManage/Contract/GetPageList",
            postData: { queryJson: JSON.stringify(queryJson) },
            datatype: "json",
            height: $(window).height() - 60,
            autowidth: true,
            colModel: [
                { label: "主键", name: "id", hidden: true },
                { label: "主键", name: "contractid", hidden: true },
                { label: "主键", name: "liveinuserid", hidden: true },
                { label: "申请单号", name: "code", index: "code", width: 200, align: "center" },
                {
                    label: "申请日期", name: "date", index: "date", width: 200, align: "center",
                    formatter: function (cellvalue, options, rowObject) {
                        return formatDate(cellvalue, 'yyyy-MM-dd hh:mm:ss');
                    }
                },
                {
                    label: "业务种类", name: "type", index: "type", width: 200, align: "center",
                    formatter: function (cellvalue, options, rowObject) {

                        switch (cellvalue) {
                            case 1: return "合同变更"; break;
                            case 2: return "合同续租"; break;
                            case 3: return "合同到期退租"; break;
                            case 4: return "合同提前退租"; break;
                            default: return ""; break;
                        }
                    }
                },
                {
                    label: "审批状态", name: "state", index: "state", width: 200, align: "center",
                    formatter: function (cellvalue, options, rowObject) {

                        switch (cellvalue) {
                            case 0: return "未提交"; break;
                            case 1: return "审批中"; break;
                            case 2: return "审批通过"; break;
                            case 3: return "审批未通过"; break;
                            default: return ""; break;
                        }
                    }
                },
                { label: "合同编号", name: "ccode", index: "ccode", width: 200, align: "center" },
                { label: "租赁房产", name: "roomallname", index: "roomallname", width: 200, align: "left" },
                { label: "承租人", name: "customername", index: "customername", width: 200, align: "left", hidden: true },
                { label: "承租人", name: "membername", index: "membername", width: 200, align: "center" },
                {
                    label: "起始日期", name: "begindate", index: "begindate", width: 200, align: "center",
                    formatter: function (cellvalue, options, rowObject) {
                        return formatDate(cellvalue, 'yyyy-MM-dd');
                    }
                },
                {
                    label: "终止日期", name: "enddate", index: "enddate", width: 200, align: "center",
                    formatter: function (cellvalue, options, rowObject) {
                        return formatDate(cellvalue, 'yyyy-MM-dd');
                    }
                },
            ],
            viewrecords: true,
            rowNum: 20,
            rowList: [20, 50, 100],
            pager: "#gridPager",
            sortname: 'date',
            sortorder: 'desc',
            rownumbers: true,
            gridview: true,
            ondblClickRow: function () {
                btn_detail();
            },
            onSelectRow: function (status) {
                selectedRowIndex = $("#" + this.id).getGridParam('selrow');
            }
        });

    }
    //退租申请
    function GetGrid4() {
        var $gridTable = $("#gridTable"); 
        var queryJson = {
            BeginDate: option.StartTime,
            EndDate: option.EndTime,
            Type: 3
        };
        $gridTable.jqGrid({
            url: "../../QualificationManage/Contract/GetPageList",
            postData: { queryJson: JSON.stringify(queryJson) },
            datatype: "json",
            height: $(window).height() - 60,
            autowidth: true,
            colModel: [
                { label: "主键", name: "id", hidden: true },
                { label: "主键", name: "contractid", hidden: true },
                { label: "主键", name: "liveinuserid", hidden: true },
                { label: "申请单号", name: "code", index: "code", width: 200, align: "center" },
                {
                    label: "申请日期", name: "date", index: "date", width: 200, align: "center",
                    formatter: function (cellvalue, options, rowObject) {
                        return formatDate(cellvalue, 'yyyy-MM-dd hh:mm:ss');
                    }
                },
                {
                    label: "业务种类", name: "type", index: "type", width: 200, align: "center",
                    formatter: function (cellvalue, options, rowObject) {

                        switch (cellvalue) {
                            case 1: return "合同变更"; break;
                            case 2: return "合同续租"; break;
                            case 3: return "合同到期退租"; break;
                            case 4: return "合同提前退租"; break;
                            default: return ""; break;
                        }
                    }
                },
                {
                    label: "审批状态", name: "state", index: "state", width: 200, align: "center",
                    formatter: function (cellvalue, options, rowObject) {

                        switch (cellvalue) {
                            case 0: return "未提交"; break;
                            case 1: return "审批中"; break;
                            case 2: return "审批通过"; break;
                            case 3: return "审批未通过"; break;
                            default: return ""; break;
                        }
                    }
                },
                { label: "合同编号", name: "ccode", index: "ccode", width: 200, align: "center" },
                { label: "租赁房产", name: "roomallname", index: "roomallname", width: 200, align: "left" },
                { label: "承租人", name: "customername", index: "customername", width: 200, align: "left", hidden: true },
                { label: "承租人", name: "membername", index: "membername", width: 200, align: "center" },
                {
                    label: "起始日期", name: "begindate", index: "begindate", width: 200, align: "center",
                    formatter: function (cellvalue, options, rowObject) {
                        return formatDate(cellvalue, 'yyyy-MM-dd');
                    }
                },
                {
                    label: "终止日期", name: "enddate", index: "enddate", width: 200, align: "center",
                    formatter: function (cellvalue, options, rowObject) {
                        return formatDate(cellvalue, 'yyyy-MM-dd');
                    }
                },
            ],
            viewrecords: true,
            rowNum: 20,
            rowList: [20, 50, 100],
            pager: "#gridPager",
            sortname: 'date',
            sortorder: 'desc',
            rownumbers: true,
            gridview: true,
            ondblClickRow: function () {
                btn_detail();
            },
            onSelectRow: function (status) {
                selectedRowIndex = $("#" + this.id).getGridParam('selrow');
            }
        });

    }
    //会员信息
    function GetGrid5() {
        var selectedRowIndex = 0;
        var $gridTable = $("#gridTable");
        var queryJson = {
            StartTime: option.StartTime,
            EndTime: option.EndTime,
            Name: option.Name,
            IDCard: option.IDCard,
            Code: option.Code
        };
        $gridTable.jqGrid({
            url: "../../QualificationManage/Member/GetListJson",
            postData: { queryJson: JSON.stringify(queryJson) },
            datatype: "json",
            height: $(window).height() - 60,
            autowidth: true,
            colModel: [
                { label: "主键", name: "Id", index: "Id", hidden: true },
                { label: "会员名称", name: "Name", index: "Name", width: 200, align: "left" },
                { label: "会员编号", name: "Code", index: "Code", width: 200, align: "left" },
                {
                    label: "性别", name: "Sex", index: "Sex", width: 200, align: "center",
                    formatter: function (cellvalue) {
                        switch (cellvalue) {
                            case 1: return "男";
                            case 2: return "女";
                            default: return "";
                        }
                    }
                },
                {
                    label: "会员状态", name: "State", index: "State", width: 200, align: "center",
                    formatter: function (cellvalue) {
                        return cellvalue == 0 ? "<span class=\"label label-danger\">无效</span>" : "<span class=\"label label-success\">有效</span>";
                    }
                },
                { label: "手机号码", name: "Phone", index: "Phone", width: 200, align: "left" },
                { label: "身份证号", name: "IDCard", index: "IDCard", width: 200, align: "left" },
                { label: "固定电话", name: "PhoneNum", index: "PhoneNum", width: 200, align: "left" },
                {
                    label: "婚姻状况", name: "MarryInfo", index: "MarryInfo", width: 200, align: "left", sortable: false,
                    formatter: function (cellvalue) {
                        switch (cellvalue) {
                            case "1": return "未婚";
                            case "2": return "已婚无子女";
                            case "3": return "已婚有子女";
                            case "4": return "离婚、离异无子女";
                            case "5": return "离婚、离异有子女";
                            default: return "未婚";
                        }
                    }
                },
                { label: "公司名称", name: "CompanyName", index: "CompanyName", width: 200, align: "left" },
                { label: "备注", name: "Description", index: "Description", width: 200, align: "left" }
            ],
            viewrecords: true,
            rowNum: 20,
            rowList: [20, 50, 100],
            pager: "#gridPager",
            sortname: 'date',
            sortorder: 'desc',
            rownumbers: true,
            gridview: true,
            ondblClickRow: function () {
                btn_detail();
            },
            onSelectRow: function () {
                selectedRowIndex = $("#" + this.id).getGridParam('selrow');
            },
            gridComplete: function () {
                $("#" + this.id).setSelection(selectedRowIndex, false);
            }
        });

    }
    //选房记录
    function GetGrid6() {
        var selectedRowIndex = 0;
        var $gridTable = $("#gridTable");
        var queryJson = {
            BeginDate: option.StartTime,
            EndDate: option.EndTime,
            Name: option.Name,
            IDCard: option.IDCard, 
            Code: option.Code,
        };
        $gridTable.jqGrid({
            url: "../../QualificationManage/SelectRoomRecord/GetPageList",
            datatype: "json",
            height: $(window).height() - 60,
            autowidth: true,
            colModel: [
                { label: "主键", name: "id", hidden: true },
                {
                    label: "选房日期", name: "choosetime", index: "choosetime", width: 140, align: "center",
                    formatter: function (cellvalue, options, rowObject) {
                        return formatDate(cellvalue, 'yyyy-MM-dd');
                    }
                },
                { label: "房间名称", name: "roomallname", index: "roomallname", width: 240, align: "left" },
                { label: "会员名称", name: "name", index: "name", width: 120, align: "center" },
                { label: "会员编号", name: "membercode", index: "membercode", width: 200, align: "center" },
                { label: "会员手机号", name: "phone", index: "phone", width: 120, align: "center" },
                {
                    label: "状态", name: "state", index: "state", width: 100, align: "center",
                    formatter: function (cellvalue, options, rowObject) {

                        switch (cellvalue) {
                            case 1: return "有效"; break;
                            case 2: return "已经签约"; break;
                            case 3: return "已取消"; break;
                            default: return cellvalue; break;
                        }
                    }
                },
                { label: "合同编号", name: "contractcode", index: "contractcode", width: 180, align: "center" },
                { label: "到期日期", name: "canceltime", index: "canceltime", width: 200, align: "center" }
            ],
            viewrecords: true,
            rowNum: 20,
            rowList: [20, 50, 100],
            pager: "#gridPager",
            sortname: 'choosetime',
            sortorder: 'desc',
            rownumbers: true,
            gridview: true,
            ondblClickRow: function () {
                btn_detail();
            },
            onSelectRow: function () {
                selectedRowIndex = $("#" + this.id).getGridParam('selrow');
            },
            gridComplete: function () {
                $("#" + this.id).setSelection(selectedRowIndex, false);
            }
        });

    }
    //看房申请
    function GetGrid7() {
        var selectedRowIndex = 0;
        $gridTable = $("#gridTable");
        var queryJson = {
            StartTime: option.StartTime,
            EndTime: option.EndTime, 
        };
        $gridTable.jqGrid({
            url: "../../QualificationManage/SearchRoom/GetPagList",
            postData: { queryJson: JSON.stringify(queryJson) },
            datatype: "json",
            height: $(window).height() - 60,
            autowidth: true,
            sortable: true,
            colModel: [
                { label: "主键", name: "id", hidden: true },
                { label: "单据编号", name: "billcode", index: "billcode", width: 300, align: "center", sortable: false, },
                { label: "单据日期", name: "date", index: "date", width: 300, align: "center", sortable: false, },
                { label: "看房地址", name: "allname", index: "allname", width: 300, align: "left", sortable: false, },
                {
                    label: "状态", name: "state", index: "state", width: 200, align: "center", sortable: false,
                    formatter: function (cellvalue, options, rowObject) {
                        var Msg = "";
                        switch (cellvalue) {
                            case 1: Msg = "<span  style='background-color:#FFA07B' class='label'>待审批</span>";
                                break;
                            case 2: Msg = "<span  style='background-color:#B9C46F' class='label '>未完成</span>";
                                break;
                            case 3: Msg = "<span  style='background-color:#4BC152' class='label '>已完成</span>";
                                break;
                            case 4: Msg = "<span  style='background-color:#D9D6CF' class='label '>已取消</span>";
                                break;
                            case 5: Msg = "<span  style='background-color:#D15252' class='label '>审批未通过</span>";
                                break;
                            default: Msg = "---";
                                break;
                        }
                        return Msg;
                    }
                },
                { label: "申请人", name: "name", index: "names", width: 200, align: "center", sortable: false },
                { label: "手机号", name: "phone", index: "phone", width: 200, align: "center", sortable: false },
                {
                    label: "性别", name: "sex", index: "sex", width: 200, align: "center", sortable: false,
                    formatter: function (cellvalue) {
                        if (cellvalue == 1) {
                            return "男";
                        }
                        return "女";
                    }
                },
                { label: "预约看房时间", name: "expecttime", index: "expecttime", width: 300, align: "center", sortable: false },
                { label: "实际带看人", name: "realman", index: "realman", width: 200, align: "center", sortable: false },
                { label: "看房情况", name: "seeroominfo", index: "seeroominfo", width: 200, align: "center", sortable: false },

            ],
            viewrecords: true,
            rowNum: 20,
            rowList: [20, 50, 100],
            pager: "#gridPager",
            sortname: 'date',
            sortorder: 'desc',
            rownumbers: true,
            gridview: true,
            ondblClickRow: function () {
                btn_detail();
            },
            onSelectRow: function () {
                selectedRowIndex = $("#" + this.id).getGridParam('selrow');
            },
            gridComplete: function () {
                $("#" + this.id).setSelection(selectedRowIndex, false);
            }
        });

    }
</script>
<div class="ui-layout" id="layout" style="height: 100%; width: 100%;">
    <div class="ui-layout-center">
        <div class="gridPanel">
            <table id="gridTable"></table>
            <div id="gridPager"></div>
        </div>
    </div>
</div>

